package com.ruoyi.web.controller.wq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wq.domain.WqVoteUser;
import com.ruoyi.wq.domain.vo.WqVoteUserVO;
import com.ruoyi.wq.service.IWqVoteUserService;

/**
 * 投票用户Controller
 * 
 * @author ruoyi
 * @date 2022-11-09
 */
@RestController
@RequestMapping("/wq/voteUser")
public class WqVoteUserController extends BaseController {
    
	@Autowired
    private IWqVoteUserService wqVoteUserService;

    /**
     * 查询投票用户列表
     */
	@Anonymous
    @GetMapping("/list")
    public TableDataInfo list(WqVoteUser wqVoteUser){
        return wqVoteUserService.getPageList(wqVoteUser);
    }

    /**
     * 新增投票用户
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody WqVoteUserVO wqVoteUser){
    	wqVoteUserService.addVote(wqVoteUser);
        return AjaxResult.success();
    }
    
    /**
     * 新增投票用户
     */
    @PostMapping("/addBatch")
    public AjaxResult addBatch(@RequestBody WqVoteUserVO wqVoteUser){
    	wqVoteUserService.addBatch(wqVoteUser);
        return AjaxResult.success();
    }
    
}
